<!--$Id: xa_config.so,v 10.23 2003/06/27 17:38:24 bostic Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: Configuring Berkeley DB with the Tuxedo System</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<a name="2"><!--meow--></a>
<table width="100%"><tr valign=top>
<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Distributed Transactions</dl></b></td>
<td align=right><a href="../xa/xa_intro.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../xa/faq.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p align=center><b>Configuring Berkeley DB with the Tuxedo System</b></p>
<p>This information assumes that you have already installed the Berkeley DB
library.</p>
<p>First, you must update the resource manager file in Tuxedo.  For the
purposes of this discussion, assume that the Tuxedo home directory is in</p>
<blockquote><pre>/home/tuxedo</pre></blockquote>
In that case, the resource manager file will be located in
<blockquote><pre>/home/tuxedo/udataobj/RM</pre></blockquote>
Edit the resource manager file, adding the line
<blockquote><pre>BERKELEY-DB:db_xa_switch:-L${DB_INSTALL}/lib -ldb \
	-lsocket -ldl -lm</pre></blockquote>
<p>where ${DB_INSTALLHOME} is the directory into which you installed the Berkeley DB
library.</p>
<p><b>Note that the previous load options are for a Sun Microsystems
Solaris 5.6 Sparc installation of Tuxedo, and may not be correct for
your system.</b></p>
<p>Next, you must build the transaction manager server.  To do this, use the
Tuxedo <b>buildtms</b>(1) utility.  The buildtms utility will create
the Berkeley-DB resource manager in the directory from which it was run.
The parameters to buildtms should be</p>
<blockquote><pre>buildtms -v -o DBRM -r BERKELEY-DB</pre></blockquote>
<p>This will create an executable transaction manager server, DBRM, which is
called by Tuxedo to process begins, commits, and aborts.</p>
<p>Finally, you must make sure that your TUXCONFIG environment variable
identifies an ubbconfig file that properly identifies your resource
managers.  In the GROUPS section of the ubb file, you should identify the
group's LMID and GRPNO, as well as the transaction manager server name
"TMSNAME=DBRM."  You must also specify the OPENINFO parameter, setting it
equal to the string</p>
<blockquote><pre>rm_name:dir</pre></blockquote>
<p>where rm_name is the resource name specified in the RM file (that is,
BERKELEY-DB) and dir is the directory for the Berkeley DB home environment
(see <a href="../../api_c/env_open.html">DB_ENV-&gt;open</a> for a discussion of Berkeley DB environments).</p>
<p>Because Tuxedo resource manager startup accepts only a single string
for configuration, any environment customization that might have been
done via the config parameter to <a href="../../api_c/env_open.html">DB_ENV-&gt;open</a> must instead be done
by placing a <a href="../../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file in the Berkeley DB environment directory.
See <a href="../../ref/env/naming.html">Berkeley DB File Naming</a> for further
information.</p>
<p>Consider the following configuration.  We have built a transaction
manager server, as described previously.  We want the Berkeley DB environment
to be <b>/home/dbhome</b>, our database files to be maintained in
<b>/home/datafiles</b>, our log files to be maintained in
<b>/home/log</b>, and we want a duplexed server.</p>
<p>The GROUPS section of the ubb file might look like the following</p>
<blockquote><pre>group_tm LMID=myname GRPNO=1 TMSNAME=DBRM TMSCOUNT=2 \
	OPENINFO="BERKELEY-DB:/home/dbhome"</pre></blockquote>
<p>There would be a <a href="../../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> configuration file in the directory
<b>/home/dbhome</b> that contained the following two lines:</p>
<blockquote><pre>set_data_dir	/home/datafiles
set_lg_dir	/home/log</pre></blockquote>
<p>Finally, the ubb file must be translated into a binary version using
Tuxedo's <b>tmloadcf</b>(1) utility, and then the pathname of that
binary file must be specified as your TUXCONFIG environment variable.</p>
<p>At this point, your system is properly initialized to use the Berkeley DB
resource manager.</p>
<p>See <a href="../../api_c/db_class.html">db_create</a> for further information on accessing data files
using XA.</p>
<table width="100%"><tr><td><br></td><td align=right><a href="../xa/xa_intro.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../xa/faq.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>
